#include <stdio.h>


void myguibing(int *arr1,int len1,int *arr2,int len2,int *arr3)
{
	int i=0;
	int j=0;
	int t=0;
	while(i<len1&&j<len2)
	{
		if(arr1[i]<arr2[j])
		{
			arr3[t]=arr1[i];
			t++;
			i++;
		}
		else
		{
			arr3[t]=arr2[j];
			t++;
			j++;
		}
		if(i==len1&&j<len2)
		{
			for(j=j;j<len2;j++)
			{
				arr3[t]=arr2[j];
				t++;
			}
		}
		if(j==len2&&i<len1)
		{
			for(i=i;i<len1;i++)
			{
				arr3[t]=arr1[i];
				t++;
			}
		}
	}
}

int main(int argc, const char *argv[])
{
	int arr1[5]={1,3,5,7,9};
	int arr2[4]={2,4,6,8};
	int arr3[9];

	int len1=sizeof(arr1)/4;
	int len2=sizeof(arr2)/4;

	myguibing(arr1,len1,arr2,len2,arr3);

	for(int i=0;i<9;i++)
	{
		printf("%d ",arr3[i]);
	}
	puts(" ");

	return 0;
}
